Auto-match Zones to Accounts via spec.managedZones (multi-account support)#446
Auto-match Zones to Accounts via spec.managedZones (multi-account support)#446romaws wants to merge 1 commit intocontaineroo:masterfrom
Conversation
- introduce account manager to handle multiple cloudflare accounts - refactor reconcile loops to use account manager - add managedZones to account spec to automatically match zones to accounts - remove cloudflareAPI from reconcilers - deprecate cloudflareAPI in account reconciler docs(readme): update readme with account management - document account management - document managedZones
|
Hey @romaws Thanks a bunch for your contribution! Since this is a bigger change, it might take a little while to review. Appreciate your patience 🙏 Cheers, |
|
Hey @romaws, I just had time to review your PR — thanks again for your patience and contribution! After an internal discussion, we’d like to propose a change regarding how ---
apiVersion: cloudflare-operator.io/v1
kind: Zone
metadata:
name: example-com
spec:
name: example.com
accountRef:
name: account-sampleWe’d like to invite you to reconsider your architecture, and we’re grateful for the time you’ve spent on this contribution. Furthermore, I’d like to suggest removing the “Heads up” section from the README, as this information will be included in the cloudflare-operator documentation. Since your change will introduce a major version bump, an upgrade guide will be necessary anyway. Best regards, |
Summary
Account.spec.managedZones.Changes
AccountManagerto map accounts and zones, resolve conflicts, and provide per-account Cloudflare clients.AccountReconcilercreates a client from Secret and registers the account + managed zones; cleans up on delete.ZoneReconciler/DNSRecordReconcilerresolve the account by zone name and use the corresponding client; emit clear errors for no/multiple matches.account-samplenow includesspec.managedZones.managedZonesrequirement.Breaking
Accountmust list all managed apex zones inspec.managedZones. Zones/DNSRecords without a matching account will not reconcile.Migration
Account, add all apex zones tospec.managedZones.apiTokenare unchanged.Testing
managedZones; ensureCF_API_TOKENandCF_ZONE_IDare set.Docs
Checklist